package com.vf.admin.client.dao;

import com.vf.admin.common.db.BaseDao;
import com.vf.admin.miaodong.entity.AgentUserRecords;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Repository
public class AgentUserMoneyRecordDao extends BaseDao<AgentUserRecords> {


    public Map<String, Object> todayMoney(Integer userId) {
        String sql = "select IFNULL(sum(money),0) as money from agent_user_money_record " +
                " where to_days(createTime) = to_days(now()) and userId = "+ userId +"";
        return this.queryObj(sql, new ArrayList<>(), Map.class);
    }

}
